import sys
from pathlib import Path
import math

# 获取当前脚本所在目录的绝对路径，并向上找到共同的父目录
common_parent = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(common_parent))


flag=False
outStr="abcdefg"
if flag:
    print("Yes")
else:
    print("No")
    if flag:
        print("Yes2")
    else:
        outStr="x"+outStr
        outStr=outStr[0:3]
        print(outStr)

print("------string测试---------")
strx="ABCDE"
print(strx[1:])


print("------list测试---------")
string_array = ["Hello", "World", "I'm", "GPT"]
for string in string_array:print(string)
int_array=[2,4,6,18]
# int_array=int_array/2.0
print(int_array)

print("-------set测试--------")
a = {"a","b","c","d","e"}
b = set("bde")
print("集合a:",a)
print("集合b:",b)
print("差集：",a - b)     
print("并集：",a | b)    
print("交集",a & b)     
print("不同时存在的元素：",a ^ b)     

print("-------dic测试--------")
dmap={"s":"王","x":"克"}
print("dict[s]:",dmap["s"])
for xtmp,xval in dmap.items():
    print(xtmp,":",xval)

print("-------function测试--------")
#可写函数说明
def printinfo( name, age ):
   "打印任何传入的字符串"
   print ("名字: ", name)
   print ("年龄: ", age)
   return    
printinfo("wang",16)

print("-------module测试--------")
import ax  
ax.show("ttt")
from sound import sound,sound2
sound("dsdsd")
sound2("dsdsd")
# import utils.sound
# utils.sound.sound("sddd")

print("-------class测试--------")
from entity.Point import Point
p=Point(1,9)
p.show()

print("?x",math.ceil(3/2.9))

